{$CLEO}

0A95: enable_thread_saving

const
  _camera_rot_z = 3@
  _get_param = 10@
  _camera_pos_x = 14@
  _camera_pos_y = 23@
  _camera_pos_z = 24@
  _camera_rot_x = 25@
  _camera_rot_y = 26@
  _value_1 = 27@
  _param = 28@
  _value_2 = 29@
  _segment_id = 30@
end

            {$CLEO}

0A95: enable_thread_saving

const
  _count = 6@
  _items = 11@
  _pos_y = 12@
  _cent = 15@
end

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------

thread 'CAMT'

0adf: "SEDN0m" "Camera Tool v1.0"
0adf: "SEDN1" "Camera Pos x"
0adf: "SEDN2" "Camera Pos y"
0adf: "SEDN3" "Camera Pos z"
0adf: "SEDN4" "Camera Rot X"
0adf: "SEDN5" "Camera Rot Y"
0adf: "SEDN6" "Camera Rot z"
0adf: "SEDN7" "Save Param"
0adf: "SEDN8" "Camera Restore"
0adf: "valuea" "(~1~)"
0adf: "valuem" "(~1~ ~1~)"
0AF0: _segment_id      = get_int_from_ini_file "CLEO\CAME.INI" section "SEGID" key "to"                         
:starth
repeat
repeat
wait 0
until if Player.Defined(0)
until if 00E1:   player 0 pressed_key 7        
//Player.CanMove(0) = False
 
8@ = -1.0 
_camera_rot_z = 0.4 
067C: put_camera_on_actor $PLAYER_ACTOR offset 0.0 -0.3 0.5 rotation 0.0 0.5 _camera_rot_z tilt 0.0 switchstyle 2
var
   _count:int
   _items:int
end

while true
    wait 0
    _pos_y = 80.0
    for _count = 0 to 9 step 1
        0085: _cent = _pos_y
        _cent -= 4.0
        038E: draw_box_position 90.0 _pos_y size 145.0 11.0 RGBA 0 0 0 150
        if _count == 0
        then                                                                                                       
            033F: set_text_draw_letter_size 0.2  0.8                                                                                                                                                                        
            060D: draw_text_shadow 1   0  0  0  200                                                                                                                                                                         
            0340: set_text_draw_RGBA 255  255  0  200                                                                                                                                                                     
            0349: set_text_draw_font 2                                                                                                                                                                                      
            0343: set_text_draw_linewidth 700.0                                                                                                                                                                             
            033E: set_draw_text_position 24.0  _cent  "SEDN0m"                                                                              
        end                  
        0AD3: 19@v = format "SEDN%x" _count     
        060D: draw_text_shadow 1 rgba 50 50 200 150                                                                                                
        0343: set_text_draw_linewidth 640.0                                                                                                                        
        081C: draw_text_outline 1 RGBA 0 0 0 100                                                                                                                   
        033F: set_text_draw_letter_size 0.2 0.9                                                       
            081C: draw_text_outline 1 RGBA 0 0 0 100                                                      
            0343: set_text_draw_linewidth 1000.0                                            
        033E: set_draw_text_position 23.0 _cent GXT 19@v
        IF _count == 1
        THEN 0087: _get_param = _camera_pos_x
        END
        IF _count == 2
        THEN 0087: _get_param = _camera_pos_y
        END
        IF _count == 3
        THEN 0087: _get_param = _camera_pos_z
        END
        IF _count == 4
        THEN 0087: _get_param = _camera_rot_x
        END
        IF _count == 5
        THEN 0087: _get_param = _camera_rot_y
        END
        IF _count == 6
        THEN 0087: _get_param = _camera_rot_z
        END
        IF AND
            _count > 0
            7 > _count
        THEN
            0092: _value_1 = float _get_param to_integer                                                              
            0093: _param = integer _value_1 to_float                                                              
            0063: _get_param -= _param // (float)                                                                   
            _get_param *= 100.0                                                                                  
            0092: _value_2 = float _get_param to_integer                                                              
            if 0 > _value_2                                                                                     
            THEN _value_2 *= -1                                                                                     
            END                                                                          
            033F: set_text_draw_letter_size 0.2 0.8                                                       
            081C: draw_text_outline 1 RGBA 0 0 0 100                                                      
            0343: set_text_draw_linewidth 1000.0                                                          
            045B: draw_text_2numbers 130.0 _cent GXT "valuem" numbers _value_1 _value_2
        END
        if _count == 7
        then                                                                                                       
            033F: set_text_draw_letter_size 0.2 0.8                                                       
            081C: draw_text_outline 1 RGBA 0 0 0 100                                                      
            0343: set_text_draw_linewidth 1000.0                                                                                                                                                                             
            045A: set_draw_text_positionWithNumber 130.0  _cent  "valuea" _segment_id                                                                     
        end                                                                                                        
        if _count == _items
        then 038E: draw_box_position 90.0 _pos_y size 140.0 11.0 RGBA 150 150 150 150
        end
        _pos_y += 11.0
    end
    03F0: enable_text_draw 0
    0494: get_joystick 0 direction_offset_to 16@ 17@ 18@ 18@
    IF and
        17@ > 0
        7@ == false                                                                                                                                                                                                           
    THEN 7@ = true
        if _items >= 8
        then _items = 1
        else _items++
        end
    end
    IF and
        0 > 17@
        7@ == false                                                                                                                                                                                                               
    THEN 7@ = true
        if 2 > _items
        then _items = 8
        else _items--
        end
    end
    if and
      not 17@ > 0
      not 0 > 17@
    then 7@ = false
    end          
    0A4A: store_joystick_X_offset_to 4@ Y_offset_to 5@                    
    9@ = Actor.Angle($PLAYER_ACTOR)                                       
    0063: 9@ -= 4@ // (float)                                             
    if _items == 1 //X                                                                                                                                                                                                                    
    then                                                                                                                                                                                                                              
        IF 16@ > 0                                                                                                                                                                                                           
        THEN _camera_pos_x += 0.1                                                                                                                                                                                                       
            ELSE IF 0 > 16@                                                                                                                                                                                                  
            THEN _camera_pos_x -= 0.1                                                                                                                                                                                                     
            END                                                                                                                                                                                                                      
        END                                                                                                                                                                                                                           
    end
    if _items == 2 //Y                                                                                                                                                                                                                  
    then                                                                                                                                                                                                                              
        IF 16@ > 0                                                                                                                                                                                                           
        THEN _camera_pos_y += 0.1                                                                                                                                                                                                            
            ELSE IF 0 > 16@                                                                                                                                                                                                  
            THEN _camera_pos_y -= 0.1                                                                                                                                                                                                     
            END                                                                                                                                                                                                                      
        END                                                                                                                                                                                                                           
    end                   
    if _items == 3 //Z                                                                                                                                                                                                                   
    then                                                                                                                                                                                                                              
        IF 16@ > 0                                                                                                                                                                                                           
        THEN _camera_pos_z -= 0.1                                                                                                                                                                                                          
                                                                                                                                                  
            ELSE IF 0 > 16@                                                                                                                                                                                                  
            THEN _camera_pos_z += 0.1                                                                                                                                                                                                      
                                                                                                                                                   
            END                                                                                                                                                                                                                      
        END                                                                                                                                                                                                                           
    end                   
    if _items == 4 //ROT X                                                                                                                                                                                                                   
    then                                                                                                                                                                                                                              
        IF 16@ > 0                                                                                                                                                                                                           
        THEN _camera_rot_x += 0.1                                                                                                                                                                                                      
                                                                                                                                                  
            ELSE IF 0 > 16@                                                                                                                                                                                                  
            THEN _camera_rot_x -= 0.1                                                                                                                                                                                                 
                                                                                                                                                   
            END                                                                                                                                                                                                                      
        END                                                                                                                                                                                                                           
    end
    if _items == 5 //ROT Y                                                                                                                                                                                                                   
    then                                                                                                                                                                                                                              
        IF 16@ > 0                                                                                                                                                                                                           
        THEN _camera_rot_y += 0.1                                                                                                                                                                                                      
                                                                                                                                                  
            ELSE IF 0 > 16@                                                                                                                                                                                                  
            THEN _camera_rot_y -= 0.1                                                                                                                                                                                                 
                                                                                                                                                   
            END                                                                                                                                                                                                                      
        END                                                                                                                                                                                                                           
    end
    if _items == 6 //ROT Z                                                                                                                                                                                                                   
    then                                                                                                                                                                                                                              
        IF 16@ > 0                                                                                                                                                                                                           
        THEN _camera_rot_z += 0.1                                                                                                                                                                                                      
                                                                                                                                                  
            ELSE IF 0 > 16@                                                                                                                                                                                                  
            THEN _camera_rot_z -= 0.1                                                                                                                                                                                                 
                                                                                                                                                   
            END                                                                                                                                                                                                                      
        END                                                                                                                                                                                                                           
    end
    if _items == 7                                                                                                                                                                                                                    
    then                                                                                                                                                                                                                              
        if and                                                                                                          
            00E1:   not player 0 pressed_key 7                                                                         
            13@ == false                                                                                                
        then 13@ = true                                                                                                 
            if 0AF0: _segment_id      = get_int_from_ini_file "CLEO\CAME.INI" section "SEGID" key "to"                        
            then                                                                                                        
                if NOT _segment_id >= 50 //MAX SEGMENTS                                                                         
                then                                                                                                    
                    _segment_id += 1 //NEXT SEGMENT                                                                             
                    0AF1: write_int _segment_id to_ini_file "CLEO\CAME.INI" section "SEGID" key "to"                          
                    if 0AF0: _segment_id      = get_int_from_ini_file "CLEO\CAME.INI" section "SEGID" key "to"                
                    then                                                                                                
                        0AD3: 19@v = format "sed%x" _segment_id                                                                 
                        0ACD: "CAMERA OFFSET SAVE" 500                                                                  
                        0AF3: write_float _camera_pos_x to_ini_file "CLEO\CAME.INI" section 19@v key  "offset_X"                 
                        0AF3: write_float _camera_pos_y to_ini_file "CLEO\CAME.INI" section 19@v key "offset_Y"                 
                        0AF3: write_float _camera_pos_z to_ini_file "CLEO\CAME.INI" section 19@v key  "offset_Z"                 
                        0AF3: write_float _camera_rot_x to_ini_file "CLEO\CAME.INI" section 19@v key "rot_x"                    
                        0AF3: write_float _camera_rot_y to_ini_file "CLEO\CAME.INI" section 19@v key "rot_y"                    
                        0AF3: write_float _camera_rot_z to_ini_file "CLEO\CAME.INI" section 19@v key "rot_z"                    
                    ELSE 0ACD: "~R~section SEGMENT ID NOT FUND" 1000                                                    
                    END                                                                                                 
                ELSE 0ACD: "~R~YOU HAVE MAX SEGMENT ID" 1000                                                            
                END                                                                                                     
            ELSE 0ACD: "~R~section SEGMENT ID NOT FUND" 1000                                                            
            END                                                                                                         
        end                                                                                                             
        if 80E1:   not player 0 pressed_key 16                                                                          
        then 13@ = false                                                                                                
        end                                                                                                                                                                                              
    end
    if _items == 8                                                                                                                                                                                                                    
    then                                                                                                                                                                                                                              
        if and                                                                                                          
            00E1:   not player 0 pressed_key 16                                                                         
            13@ == false                                                                                                
        then 13@ = true                                                                                                 
            CAMERA.Restore_WithJumpCut                                                                                
        end                                                                                                             
        if 80E1:   not player 0 pressed_key 16                                                                          
        then 13@ = false                                                                                                
        end                                                                                                                                                                                              
    end
    if or 
    _items == 1
    _items == 2
    _items == 3
    _items == 4
    _items == 5
    _items == 6
    then
        if or
        16@ > 0
        0 > 16@
        then
            067C: put_camera_on_actor $PLAYER_ACTOR offset _camera_pos_x _camera_pos_y _camera_pos_z rotation _camera_rot_x _camera_rot_y _camera_rot_z tilt 0.0 switchstyle 2      
            5@ /= 200.0                                                                                               
            005B: _camera_rot_z += 5@ // (float)                                                                                
            4@ /= 200.0                                                                                               
            005B: _camera_rot_y += 4@ // (float)                                                                                
            067C: put_camera_on_actor $PLAYER_ACTOR offset _camera_pos_x _camera_pos_y _camera_pos_z rotation _camera_rot_x _camera_rot_y _camera_rot_z tilt 0.0 switchstyle 2      
        end
    end
    if 0ab0: 55
    then 03F0: enable_text_draw 0
        Camera.SetBehindPlayer
        Camera.Restore_WithJumpCut
        Player.CanMove(0) = true
        goto @starth
    end                                                                                                         
end 


